import com.google.appengine.api.datastore.Entity
import com.google.appengine.api.datastore.Blob
import com.google.appengine.api.datastore.Key
import com.google.appengine.api.datastore.*
import static com.google.appengine.api.datastore.FetchOptions.Builder.*
import com.pobos.model.*


def idSitio = params.id

if (idSitio) {	
	Entity sitio = obtenSitio(idSitio)
	request['sitio'] = sitio
	request['idSitio'] = idSitio
	forward "/verSitio.gtpl"
} else {
	request.erro = "Non se atopou ese sitio!"
	forward '/erro.gtpl'
}
	

def obtenSitio(String id) {
	def key = KeyFactory.createKey("Sitio", Long.parseLong(id))			
	return datastore.get(key)
}  



